package com.leftheart.service.impl;

import com.leftheart.entity.Books;
import com.leftheart.mapper.BooksMapper;
import com.leftheart.service.BooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BooksServiceImpl implements BooksService {
    @Autowired
    BooksMapper booksMapper;

    @Override
    public int addBook(Books books) {
        return booksMapper.addBook(books);
    }

    @Override
    public int deleteBookById(int bookId) {
        return booksMapper.deleteBookById(bookId);
    }

    @Override
    public int updateBook(Books books) {
        return booksMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int bookId) {
        return booksMapper.queryBookById(bookId);
    }

    @Override
    public List<Books> queryAllBook(){ return booksMapper.queryAllBook(); }
    @Override
    public List<Books> queryBookByName(String bookName) { return booksMapper.queryBookByName(bookName); }

    }

